#pragma once

template <typename T>
inline void SAFE_DELETE(T& p) { if (p) { delete p; p = nullptr; } }

template <typename T>
inline void SAFE_DELETE_ARRAY(T& p) { if (p) { delete[] p; p = nullptr; } }

template <typename T>
inline void CC_DELETE(T& p) { if (p) { delete p; p = nullptr; } }

template <typename T>
inline void CC_DELETE_ARRAY(T& p) { if (p) { delete[] p; p = nullptr; } }

template <typename T>
inline void CC_RELEASE(T& p) { if (p) { p->release(); p = nullptr; } }